package com.miplus.ccrm.core.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 参与筛选的列
 * @TableName cp_calllist_querydatacol
 */
@TableName(value ="cp_calllist_querydatacol")
@Data
public class CpCalllistQuerydatacol implements Serializable {
    /**
     * 列名
     */
    private String colname;

    /**
     * 数据库名
     */
    private String dbname;

    /**
     * 列所在的表名
     */
    private String tablename;

    /**
     * 表结构中数据类型
     */
    private String datatype;

    /**
     * 表在最终拼接sql中的缩写
     */
    private String tableas;

    /**
     * 列名解释/说明
     */
    private String coldesc;

    /**
     * 列类型   sys_names.ACTIVITY.QUERY.COLTYPE
     */
    private String coltype;

    /**
     * 拼接： 表名.列名 ，也是被其他表关联的主键
     */
    private String splicecol;

    /**
     * 列在使用时真正的使用类型，例：表结构中是varchar，但是实际使用中其实是date型数据
     */
    private String usedatatype;

    /**
     * 如果需要转换类型时，对于列的前置sql，配合colafter使用，例：to_date(
     */
    private String colbefore;

    /**
     * 如果需要转换类型时，对于列的结束sql，配合colbefore使用，例：,'yyyy-mm-dd')
     */
    private String colafter;

    /**
     * 
     */
    private String formatcheck;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CpCalllistQuerydatacol other = (CpCalllistQuerydatacol) that;
        return (this.getColname() == null ? other.getColname() == null : this.getColname().equals(other.getColname()))
            && (this.getDbname() == null ? other.getDbname() == null : this.getDbname().equals(other.getDbname()))
            && (this.getTablename() == null ? other.getTablename() == null : this.getTablename().equals(other.getTablename()))
            && (this.getDatatype() == null ? other.getDatatype() == null : this.getDatatype().equals(other.getDatatype()))
            && (this.getTableas() == null ? other.getTableas() == null : this.getTableas().equals(other.getTableas()))
            && (this.getColdesc() == null ? other.getColdesc() == null : this.getColdesc().equals(other.getColdesc()))
            && (this.getColtype() == null ? other.getColtype() == null : this.getColtype().equals(other.getColtype()))
            && (this.getSplicecol() == null ? other.getSplicecol() == null : this.getSplicecol().equals(other.getSplicecol()))
            && (this.getUsedatatype() == null ? other.getUsedatatype() == null : this.getUsedatatype().equals(other.getUsedatatype()))
            && (this.getColbefore() == null ? other.getColbefore() == null : this.getColbefore().equals(other.getColbefore()))
            && (this.getColafter() == null ? other.getColafter() == null : this.getColafter().equals(other.getColafter()))
            && (this.getFormatcheck() == null ? other.getFormatcheck() == null : this.getFormatcheck().equals(other.getFormatcheck()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getColname() == null) ? 0 : getColname().hashCode());
        result = prime * result + ((getDbname() == null) ? 0 : getDbname().hashCode());
        result = prime * result + ((getTablename() == null) ? 0 : getTablename().hashCode());
        result = prime * result + ((getDatatype() == null) ? 0 : getDatatype().hashCode());
        result = prime * result + ((getTableas() == null) ? 0 : getTableas().hashCode());
        result = prime * result + ((getColdesc() == null) ? 0 : getColdesc().hashCode());
        result = prime * result + ((getColtype() == null) ? 0 : getColtype().hashCode());
        result = prime * result + ((getSplicecol() == null) ? 0 : getSplicecol().hashCode());
        result = prime * result + ((getUsedatatype() == null) ? 0 : getUsedatatype().hashCode());
        result = prime * result + ((getColbefore() == null) ? 0 : getColbefore().hashCode());
        result = prime * result + ((getColafter() == null) ? 0 : getColafter().hashCode());
        result = prime * result + ((getFormatcheck() == null) ? 0 : getFormatcheck().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", colname=").append(colname);
        sb.append(", dbname=").append(dbname);
        sb.append(", tablename=").append(tablename);
        sb.append(", datatype=").append(datatype);
        sb.append(", tableas=").append(tableas);
        sb.append(", coldesc=").append(coldesc);
        sb.append(", coltype=").append(coltype);
        sb.append(", splicecol=").append(splicecol);
        sb.append(", usedatatype=").append(usedatatype);
        sb.append(", colbefore=").append(colbefore);
        sb.append(", colafter=").append(colafter);
        sb.append(", formatcheck=").append(formatcheck);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}